package com.jungle.sp.daily.feature.d7_virtual_thread;

import java.util.concurrent.Callable;

/**
 * @author Jungle
 * @create 2024-07-14 9:24
 */
public record MyCallable(int n) implements Callable<String> {

    @Override
    public String call() throws Exception {
        int sum = 0;
        for (int i = 0; i < n; i++) {
            sum += i;
        }
        return STR."\{Thread.currentThread()}线程求出了1-\{n}的和是:\{sum}";
    }
}
